package com.ruoyi.api.abuwx.service.impl;

import com.ruoyi.abuwx.domain.AbuwxUserFeedback;
import com.ruoyi.abuwx.service.impl.AbuwxUserFeedbackServiceImpl;
import com.ruoyi.api.abuwx.domain.dto.FeedbackDto;
import com.ruoyi.api.abuwx.service.ICFeedbackService;
import com.ruoyi.common.utils.satoken.StpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author zouhuu
 * @description 客户端 用户反馈管理模块服务层
 * @date 2022/07/04 16:22:46
 */
@Service
public class AbuwxFeedbackServiceImpl implements ICFeedbackService {

    @Autowired
    private AbuwxUserFeedbackServiceImpl abuwxUserFeedbackService;



    /**
     * 用户反馈
     * @param feedbackDto
     * @return
     */
    @Override
    public int feedback(FeedbackDto feedbackDto) {
        AbuwxUserFeedback abuwxUserFeedback = new AbuwxUserFeedback();
        abuwxUserFeedback.setUid(StpClientUtil.getLoginIdAsLong());
        abuwxUserFeedback.setName(feedbackDto.getName());
        abuwxUserFeedback.setPhone(feedbackDto.getPhone());
        abuwxUserFeedback.setContent(feedbackDto.getContent());
        abuwxUserFeedback.setImg(feedbackDto.getImg());
        abuwxUserFeedback.setAffiliatedUnit(feedbackDto.getAffiliatedUnit());
        return abuwxUserFeedbackService.insertAbuwxUserFeedback(abuwxUserFeedback);
    }
}
